package ipt.capitulo10;
import java.io.*;
public class VerDirectorios{
	public static void main(String args[]){
		String nombreD;
		InputStreamReader f=
					new InputStreamReader(System.in);
		BufferedReader teclado = new BufferedReader(f);
		try{
			System.out.println( "Nombre del directorio");
			nombreD = teclado.readLine();
			verDirectorios(nombreD);
		}catch (Exception e){
			System.out.println(e.getMessage());
		}
	}
	static void verDirectorios(String directorio){
		try{
			File fc = new File(directorio);
			File [] lista = fc.listFiles();
			for(int i=0; i<lista.length;i++){
				if(lista[i].isDirectory())
					verDirectorios(lista[i].toString());
				System.out.println(lista[i].toString());
			}
		}catch (Exception e){
			System.out.println(e.getMessage());
		}
	}
}

